import { createRouter, createWebHistory } from 'vue-router'
// import HomeView from '../views/HomeView.vue'
import Layout from '@/views/layout/index.vue'
import login from '@/views/login/index.vue'
import User from '@/views/user/index.vue'
import Category from '@/views/category/index.vue'
import Supplier from '@/views/supplier/index.vue'
import Area from '@/views/area/index.vue'
import ItemView from '@/views/item/index.vue'
import AddItemView from '@/views/item/add.vue'
import Socket from '@/views/socket/index.vue'
import Warehouse from '@/views/warehouse/index.vue'
import Logistics from '@/views/logistics/index.vue'
import WarehousingEntry from '@/views/warehousingentry/index.vue'
import OutBound from '@/views/outbound/index.vue'
import Stocktaking from '@/views/stocktaking/index.vue'
import StocktakingInfo from '@/views/stocktaking/info/index.vue'
import StocktakingLoss from '@/views/stocktaking/loss/index.vue'
import StocktakingTask from '@/views/stocktaking/task/index.vue'
import StocktakingTaskDetails from '@/views/stocktaking/taskdetails/index.vue'
import Operations from '@/views/warehouseoperations/index.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'Layout',
      component: Layout,
      children: [
        // {
        //   path: '',
        //   redirect: { name: 'Layout' }
        // },
        {
          path: '/user',
          name: 'User',
          component: User
        }, {
          path: '/category',
          name: 'Category',
          component: Category
        }, {
          path: '/supplier',
          name: 'Supplier',
          component: Supplier
        }, {
          path: '/area',
          name: 'Area',
          component: Area
        }, {
          path: '/item/list',
          name: 'item',
          component: ItemView
        }, {
          path: '/item/add',
          name: 'addItem',
          component: AddItemView
        }, {
          path: '/socket',
          name: 'Socket',
          component: Socket
        }, {
          path: '/warehouse',
          name: 'Warehouse',
          component: Warehouse
        }, {
          path: '/logistics',
          name: 'Logistics',
          component: Logistics
        }, {
          path: '/logistics',
          name: 'Logistics',
          component: Logistics
        }, {
          path: '/warehousingEntry',
          name: 'WarehousingEntry',
          component: WarehousingEntry
        }, {
          path: '/outbound',
          name: 'OutBound',
          component: OutBound
        }, {
          path: '/stocktaking',
          name: 'Stocktaking',
          component: Stocktaking,
          children: [
            {
              path: 'info',
              name: 'StocktakingInfo',
              component: StocktakingInfo
            },
            {
              path: 'loss',
              name: 'StocktakingLoss',
              component: StocktakingLoss
            },
            {
              path: 'task',
              name: 'StocktakingTask',
              component: StocktakingTask
            },
            {
              path: 'taskdetails',
              name: 'StocktakingTaskDetails',
              component: StocktakingTaskDetails
            }
          ]
        },
        {
          path: '/operations',
          name: 'Operations',
          component: Operations
        }
      ]
    },
    {
      path: '/login',
      name: 'login',
      component: login
    }
  ],
})

export default router